#!/bin/sh
nucli=`uname -r`
if [ -f makeliveusbcd-$nucli.deb ]; then
mv makeliveusbcd-$nucli.deb makeliveusbcd-$nucli.deb.bak
fi
rm -f makeliveusbcd-*.deb
develdir=`pwd`
cp -a /usr/lib/grub/*/* $develdir/makeliveusbcd/etc/initramfs-tools-live/MASTERLIVEUSBCD/boot/grub/
dir=`basename $develdir`
temp=/tmp/$dir
mkdir -p $temp
cp -a ./* $temp/
find $temp -type d -name .svn -print0 | xargs -0 rm -rf 
cd $temp/makeliveusbcd
rm -f DEBIAN/md5sums
find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
cd ..
echo 2.0 > debian-binary
dpkg-deb -b makeliveusbcd
cp -a makeliveusbcd.deb $develdir/
sftp -o port=33022 cosa@serni.net
rm -rf $temp
